// SEE END OF FILE FOR LICENSE TERMS

//#include "../libUDB/libUDB.h"

#ifndef SENSORS_H
#define SENSORS_H

// This is a collection of sensor data.


typedef enum
{
	VOLTAGE_RECEIVER = 0,	// Receiver voltage
	VOLTAGE_RX_BATT,		// Receiver battery
	VOLTAGE_MOTOR,			// Motor voltage
	VOLTAGE_SERVO,			// Servo voltage
	VOLTAGE_MAX
} Voltages;

// Baromentric pressure
// 	LSB = 1uBar = 0.001mbar = 0.1pascal
// 	Full range is 429.47bar
extern unsigned long barometricPressure;
#define BARO_PRESSURE_FULLSCALE		429.47	//

// Temperature of the barometric sensor. 
//	LSB = 0.01C
// 	Range is +-327.67C (not physically possible I know!)
extern int barometricTemperature;
#define BARO_TEMP_FULLSCALE			327.68

// Ground barometric pressure, used to correct for atmospheric pressure changes
// 	LSB = 1uBar = 0.001mbar = 0.1pascal
// 	Full range is 4294bar
extern unsigned long groundPressure;
#define GROUND_PRESSURE_FULLSCALE	429.497

// Pitot differential pressure in uBar = 0.001mbar = 0.1pascal
// Full range is 2147.48bar
extern long pitotDiffPressure;
#define PITOT_PRESSURE_FULLSCALE	2147.48

// pitotStaticPressure pressure in uBar = 0.001mbar = 0.1pascal
// Full range is 4294.7bar
extern unsigned long pitotStaticPressure;

// Air Temperature
//	LSB = 0.01C
// 	Range is +-327.67C (not physically possible I know!)
extern unsigned int airTemperature;

// Engine Temperature
//	LSB = 0.1C
// 	Range is +-3276.7C (not physically possible I know!)
extern unsigned int engineTemperature;

// Voltages
// LSB = 1mV
// Full scale = 65.54V
extern unsigned int voltages[VOLTAGE_MAX];

// Currents
// LSB = 1mA
// Full scale = +-2MA (enough!)
extern long currents[VOLTAGE_MAX];

// Battery consumption
// LSB = 1uAhr
// Full scale = +-2KAHr
extern long currentConsumption[VOLTAGE_MAX];

// Battery remaining
// LSB = 0.01%
// Full scale = +-300%
extern int batteryRemaining[VOLTAGE_MAX];


#endif	// SENSORS_H


/****************************************************************************/
// This is part of the servo and radio interface software
//
// ServoInterface source code
//	http://code.google.com/p/rc-servo-interface
//
// Copyright 2010 ServoInterface Team
// See the AUTHORS.TXT file for a list of authors of ServoInterface.
//
// ServoInterface is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// ServoInterface is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License 
// along with ServoInterface.  If not, see <http://www.gnu.org/licenses/>.
//
// Many parts of ServoInterface use either modified or unmodified code
// from the MatrixPilot pilot project.
// The project also contains code for modifying MatrixPilot to operate
// with ServoInterface.
// For details, credits and licenses of MatrixPilot see the AUTHORS.TXT file.
// or see this website: http://code.google.com/p/gentlenav
/****************************************************************************/
